#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <assert.h>
#include <string.h>
char* my_strncat(char* destion, const char* source, size_t num)
{
	assert(destion && source);
	char* ret = destion;
	int sz = strlen(source);
	int a = sz < num ? sz : num;
	while (*destion != '\0')
	{
		destion++;
	}
	while (a--)
	{
		*destion = *source;
		destion++;
		source++;
	}
	*destion = '\0';
	return ret;
}
int main()
{
	char arr1[99] = "abcdef";
	char arr2[] = "bcdefafa";
	char* ret = my_strncat(arr1, arr2, 99);
	printf("%s\n", ret);
	printf("%s\n", arr1);
	return 0;
}